package com.module.sysconfig.service.impl;

import java.io.IOException;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.module.sysconfig.dao.BmgzMapper;
import com.module.sysconfig.service.IBmgzService;
import com.support.cache.annotation.CacheEvict;
import com.support.cache.annotation.Cacheable;
import com.support.cache.annotation.KeyMode;
import com.support.jdbc.Page;

@Service
public class BmgzServiceImpl implements IBmgzService
{

	@Autowired
	private BmgzMapper bmgzMapper;

	/**
	 * 保存 编码规则
	 * @param params
	 */
	@Override
	@CacheEvict(key="ALL_BMGZ_RECORD")
	public void saveBmgz(Map<String, String> params)
	{
		bmgzMapper.saveBmgz(params);
	}
	/**
	 * 删除 编码规则
	 * @param id
	 */
	@CacheEvict(key="ALL_BMGZ_RECORD")
	public void deleteBmgz(String id)
	{
		bmgzMapper.deleteBmgz(id);
	}
	
	/**
	 * 修改 编码规则
	 * @param params
	 */
	@CacheEvict(key="ALL_BMGZ_RECORD")
	public void updateBmgz(Map<String, String> params)
	{
		bmgzMapper.updateBmgz(params);
	}
	
	/**
	 * 查询 编码规则
	 * @param params
	 */
	@SuppressWarnings({ "unchecked", "rawtypes" })
	@Cacheable(key="ALL_BMGZ_RECORD", keyMode=KeyMode.KEY_ONLY)
	public Page queryBmgz(Page page)
	{
		page.setResults(bmgzMapper.queryBmgzRecord(page));
		
		return page;
	}
	
	
	/**
	 * 保存 编码记录
	 */
	public void saveBmjl(Map<String, String> params)
	{
		bmgzMapper.saveBmjl(params);
	}
	
	
	/**
	 * 删除 编码记录
	 * @throws IOException
	 */
	public void deleteBmjl(String id)
	{
		bmgzMapper.deleteBmjl(id);
	}
	
	/**
	 * 修改 编码记录
	 * @throws IOException
	 */
	public void updateBmjl(Map<String, String> params)
	{
		bmgzMapper.updateBmjl(params);
	}
	
	/**
	 * 查询 编码记录
	 * @throws IOException
	 */
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public Page queryBmjl(Page page)
	{
		page.setResults(bmgzMapper.queryBmjlRecord(page));
		
		return page;
	}

	/**
	 * 保存 编码规则详情
	 * @param bdck
	 */
	public void saveGzxq(Map<String, String> params)
	{
		bmgzMapper.saveGzxq(params);
	}
	
	/**
	 * 删除 编码规则详情
	 * @param id
	 */
	public void deleteGzxq(String id)
	{
		bmgzMapper.deleteGzxq(id);
	}
	/**
	 * 修改 编码规则详情
	 * @param id
	 */
	public void updateGzxq(Map<String, String> params)
	{
		bmgzMapper.updateGzxq(params);
	}
	
	/**
	 * 查询 编码规则详情
	 * @return
	 */
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public Page queryGzxq(Page page)
	{
		page.setResults(bmgzMapper.queryGzxqRecord(page));
		
		return page;
	}
	
	
	
	
	

	/**
	 * 保存 规则关系
	 * @param params
	 */
	@CacheEvict(key="ALL_BMGZGX_RECORD")
	public void saveBmgzgx(Map<String, String> params)
	{
		bmgzMapper.saveBmgzgx(params);
	}
	/**
	 * 删除 编码规则关系
	 * @param id
	 */
	@CacheEvict(key="ALL_BMGZGX_RECORD")
	public void deleteBmgzgx(String id)
	{
		bmgzMapper.deleteBmgzgx(id);
	}
	
	/**
	 * 修改 编码规则关系
	 * @param id
	 */
	@CacheEvict(key="ALL_BMGZGX_RECORD")
	public void updateBmgzgx(Map<String, String> params)
	{
		bmgzMapper.updateBmgzgx(params);
	}
	/**
	 * 查询 编码规则关系
	 * @return
	 */
	@SuppressWarnings({ "rawtypes", "unchecked" })
	@Cacheable(key="ALL_BMGZGX_RECORD", keyMode=KeyMode.KEY_ONLY)
	public Page queryBmgzgxRecord(Page page)
	{
		page.setResults(bmgzMapper.queryBmgzgxRecord(page));
		return page;
	}
}
